// Abstract shape class
// The basis of all drawable shapes is here.

package button_tools;

import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.geom.Point2D;

/**
 *
 * @author tnull
 */
public abstract class TShape {

    // Enumeration for different shapes and tools
    public enum SHAPE_TYPE { LINE, CIRCLE, TRIANGLE, BRUSH, RECTANGLE };

    // OTHER DATA TYPES THAT ARE SELF EXPLANATORY
    protected boolean m_Filled;
    protected Point2D[] m_Points;
    protected int m_ID;
    protected SHAPE_TYPE m_ShapeType;
    protected Color m_Color;
    protected int m_x;
    protected int m_y;
    protected int m_width;
    protected int m_height;

    // constructor takes a color object and two points
    public TShape(Color c, int x, int y, int w, int h) {
        m_Color = c;
        m_x = x;
        m_y = y;
        m_height = h;
        m_width = w;
    }
    
    // alternate constructor specfically for the triangle
    public TShape(Color c, Point2D p1, Point2D p2, Point2D p3) {
        m_Color = c;
    }
        
    // set the type of shape, list is available above
    public void setType(SHAPE_TYPE type) {
        m_ShapeType = type;
    }

    // return shape type
    public SHAPE_TYPE getType() {
        return (m_ShapeType);
    }

    // set filled
    public void setFilled(boolean bool) {
        m_Filled = bool;
    }

    // get filled
    public boolean getFilled() {
        return (m_Filled);
    }
    
    public int getM_height() {
        return m_height;
    }

    public void setM_height(int m_height) {
        this.m_height = m_height;
    }

    public int getM_width() {
        return m_width;
    }

    public void setM_width(int m_width) {
        this.m_width = m_width;
    }

    public int getM_x() {
        return m_x;
    }

    public void setM_x(int m_x) {
        this.m_x = m_x;
    }

    public int getM_y() {
        return m_y;
    }

    public void setM_y(int m_y) {
        this.m_y = m_y;
    }
    
    public int getColor() {
        return m_Color.getRGB();
    }
    
    // drawing function, every shape must implement their own drawing method
    // takes a Graphics2D object that is passed to paintComponent.
    protected abstract void draw(Graphics2D g2d);
    
}